package mjc.compiler;

public class INFOMETHODE extends INFO {

	private static final long serialVersionUID = 1L;
	
	private DTYPE typeDeRetour;
	private PARAMETRES params;
	private SIGNATURE signature;
	private String visibilite;
	private TDS varsLocales;
	
	
	public INFOMETHODE(String _nom, PARAMETRES _params, DTYPE _type, String _visibilite) {
		super(_nom);
		typeDeRetour = _type;
		params = _params;
		visibilite = _visibilite;
		varsLocales = new TDS();
		isMethode = true;
	}
	
	public void setSignature(SIGNATURE s) {
		signature = s;
	}
	
	public void addVarLocale(Couple<String, DTYPE> c) {
		INFOATTRIBUT v = new INFOATTRIBUT(c.fst, c.snd);
		varsLocales.inserer(c.fst, v);
	}
	
	public DTYPE getType() {
		System.out.println(typeDeRetour);
		return typeDeRetour;
	}
	
	public String getNom() {
		return nom;
	}
	
	public String getVisibilite() {
		return visibilite;
	}
	
	public String toString() {
		return "METHODE "+visibilite+" "+nom+" : "+typeDeRetour.getNom()+params.toString();
	}

	public void setVarsLocales(TDS vars) {
		varsLocales = vars;
	}
	
	

}
